home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / lisp / eulisp / you-075a.lha / you-075a / lamport.h < prev    next >
C/C++ Source or Header  |  1992-06-18  |  797b  |  35 lines

  1. typedef int ProcID;
  2. typedef int Flag;
  3.  
  4. struct dijkstra_semaphore {
  5.   Flag b[MAX_PROCESSORS];
  6.   Flag c[MAX_PROCESSORS];
  7.   ProcID k;
  8. };
  9.  
  10. typedef struct dijkstra_semaphore* DijkstraSemaphore;
  11.  
  12. #define NONPROCID (-1)
  13.  
  14. #ifndef TRUE
  15. #define TRUE (1)
  16. #define FALSE (0)
  17. #endif
  18.  
  19. extern int system_running_processors;
  20. #define RUNNING_PROCESSORS() (system_running_processors)
  21.  
  22. extern void dijkstra_initialise(DijkstraSemaphore);
  23. extern void dijkstra_enter(DijkstraSemaphore,ProcID);
  24. extern void dijkstra_exit(DijkstraSemaphore,ProcID);
  25.  
  26. /* Hacked lamport conversion... */
  27.  
  28. #define lamport_initialise(s) dijkstra_initialise(s)
  29. #define lamport_enter(s,i) dijkstra_enter(s,i)
  30. #define lamport_exit(s,i) dijkstra_exit(s,i)
  31.  
  32. #define lamport_semaphore dijkstra_semaphore
  33. #define LamportSemaphore DijkstraSemaphore
  34.  
  35.